function ajaxFileUpload()
{
	$("#loading")
	.ajaxStart(function(){
		$(this).show();
	})
	.ajaxComplete(function(){
		$(this).hide();
	});

	$.ajaxFileUpload
	(
		{
			url: $base_url + 'ads/ajax_upload/fileToUpload',
			secureuri:false,
			fileElementId:'fileToUpload',
			dataType: 'json',
			success: function (data, status)
			{
				if(typeof(data.error) != 'undefined')
				{
					if(data.error != '')
					{
						alert(data.error);
					} else {
						$file_name = data.msg;
						$uri_path = data.msg2;
						$html = '<div><input type="checkbox" id="ckb_uri_path[]" name="ckb_uri_path[]" value="'+$uri_path+'" checked>'+
									'<span id="messages" style="display:inner-block;font-weight:bold; color:red;">'+$file_name+'</span>'+
									'<img width="50px" height="50px" src="'+$base_url+'images/upload/'+$uri_path+'"></div>';
						
						$('#div_uri_path').append($html);
					}
				}
			},
			error: function (data, status, e)
			{
				alert(e);
			}
		}
	)
	
	return false;

}